package com.rtx.edi.system.login.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rtx.edi.system.login.service.AuthUserServices;
import com.rtx.model.emums.EnumDataType;
import com.rtx.model.po.entity.system.User;
import com.rtx.model.po.service.UserDAO;

@Service
public class AuthAuthUserServicesImpl implements AuthUserServices {

    @Autowired
    private UserDAO userService;

    @Override
    public User queryUserByUsername(String username) {
        return userService.queryUserByUsername(EnumDataType.DEFAULT_DATASOURCE_KEY.getValue(), username);
    }

    /**
     * 更新上次登录日期
     *
     * @param user
     * @throws Exception
     */
    @Override
    public void updateLastLoginDate(User user) throws Exception {
    	userService.updateLastLoginDate(EnumDataType.DEFAULT_DATASOURCE_KEY.getValue(),user);
    }
}
